package cn.sofwin.day0126.homework.Pet;

import java.util.Scanner;

public class Penguin extends Pet{
    Scanner sc = new Scanner(System.in);

    // 企鹅性别
    private String sex;

    public Penguin(String name, int health, int love) {
        super(name, health, love);
        System.out.print("请选择企鹅的性别：（1.Q仔 2.Q妹）");
        switch (sc.nextInt()){
            case 1:
                this.sex = "雄";
                break;
            case 2:
                this.sex = "雌";
                break;
            default:
                System.out.println("输入有误");
        }
    }

    public String getSex() {
        return sex;
    }

    @Override
    public void print() {
        System.out.println("宠物的自白：");
        System.out.print("我的名字叫" + super.getName());
        System.out.print("，我的健康值是" + super.getHealth());
        System.out.print("，我和主人的亲密程度是" + super.getLove());
        System.out.println("，我的性别是" + getSex());
    }
}
